package com.green.voluntaryfiling.util;

public class HistoryRankingByScoreUtil {

    /**
     *
     * @param score 学生输入分数
     * @param ranking 学生输入排位
     * @param realRanking 算法匹配的排位
     * @return
     */
    public static boolean isRankingByScore(int score,int ranking,int realRanking){


       if(score>=650){
           int bottomRanking = realRanking -100;
           int topRanking =realRanking +100;
           if(ranking>=bottomRanking&&ranking<=topRanking){
               return true;
           }else{
               return false;
           }

       }else if(score>=600){
           int bottomRanking = realRanking -300;
           int topRanking =realRanking +300;
           if(ranking>=bottomRanking&&ranking<=topRanking){
               return true;
           }else{
               return false;
           }
       }else if(score>=575){
           int bottomRanking = realRanking -500;
           int topRanking =realRanking +500;
           if(ranking>=bottomRanking&&ranking<=topRanking){
               return true;
           }else{
               return false;
           }
       }else if(score>=550){
           int bottomRanking = realRanking -900;
           int topRanking =realRanking +900;
           if(ranking>=bottomRanking&&ranking<=topRanking){
               return true;
           }else{
               return false;
           }
       }else if(score>=525){
           int bottomRanking = realRanking -1500;
           int topRanking =realRanking +1500;
           if(ranking>=bottomRanking&&ranking<=topRanking){
               return true;
           }else{
               return false;
           }
       }else if(score>=500){
           int bottomRanking = realRanking -1800;
           int topRanking =realRanking +1800;
           if(ranking>=bottomRanking&&ranking<=topRanking){
               return true;
           }else{
               return false;
           }
       }else if(score>=350) {
           int bottomRanking = realRanking - 2000;
           int topRanking = realRanking + 2000;
           if (ranking >= bottomRanking && ranking <= topRanking) {
               return true;
           } else {
               return false;
           }
       }else if(score>=300) {
           int bottomRanking = realRanking - 1800;
           int topRanking = realRanking + 1800;
           if (ranking >= bottomRanking && ranking <= topRanking) {
               return true;
           } else {
               return false;
           }
       }else if(score>=250) {
           int bottomRanking = realRanking - 1400;
           int topRanking = realRanking + 1400;
           if (ranking >= bottomRanking && ranking <= topRanking) {
               return true;
           } else {
               return false;
           }
       }else if(score>=200) {
           int bottomRanking = realRanking - 700;
           int topRanking = realRanking + 700;
           if (ranking >= bottomRanking && ranking <= topRanking) {
               return true;
           } else {
               return false;
           }
       }


        return false;
    }
}
